<?php
// +----------------------------------------------------------------------
// | OnlineRetailers [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2003-2023 www.yisu.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 王强 <13052079525>
// +----------------------------------------------------------------------
namespace tasks\demo\model;

use core\lib\Model;

abstract class AbstractGetDataModel
{
    protected  $data = array();
    
    protected  static $modelObj;
    
    protected $dbKey = 'DB';
    
    protected $tableName = '';
    
    /**
     * @return the $goodsData
     */
    public function getData()
    {
        return $this->data;
    }
    
    /**
     * @param multitype: $goodsData
     */
    public function setData($goodsData)
    {
        $this->data = $goodsData;
    }
    
    /**
     * 获取数据表操作对象
     */
    public function setModel()
    {
        if (!(self::$modelObj instanceof Model)) {
            self::$modelObj = new Model($this->tableName, null, $this->dbKey);
        }
        
        self::$modelObj->table($this->tableName);
    }
    
    /**
     * @return the $dbKey
     */
    public function getDbKey()
    {
        return $this->dbKey;
    }

    /**
     * @param string $dbKey
     */
    public function setDbKey($dbKey)
    {
        $this->dbKey = $dbKey;
    }

    /**
     * 获取结果
     */
    abstract public function getResult ();
}